package cn.huoyingkeji.system.service.impl;

import cn.huoyingkeji.system.dto.UserDTO;
import cn.huoyingkeji.system.entity.SysUser;
import cn.huoyingkeji.system.mapper.SysUserMapper;
import cn.huoyingkeji.system.service.UserService;
import cn.hutool.core.bean.BeanUtil;
import cn.huoyingkeji.mybitisplus.service.impl.MybatisplusServiceImpl;

import org.springframework.stereotype.Service;

@Service
public class SysUserServiceServiceImpl extends MybatisplusServiceImpl<SysUserMapper, SysUser, UserDTO> implements UserService{

    @Override
    public UserDTO toDTO(SysUser user) {
        UserDTO userDTO = new UserDTO();
        BeanUtil.copyProperties(user, userDTO, false);
        return userDTO;
    }

    @Override
    public SysUser toEntity(UserDTO dto) {
        SysUser entity = new SysUser();
        BeanUtil.copyProperties(dto, entity , false);
        return entity;
    }

    
}
